package liangtWorkSpace.validation.advice;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName MyTestController
 * @Description : 功能说明
 * @Author : LiangT
 * @Date : 2020/5/14 22:20
 */
@RestController
public class MyTestController {

    @RequestMapping("/homeMyException")
    public String home() throws Exception {
        throw new MyException("homeMyException 错误",101);

    }

    @RequestMapping("/homeException")
    public String homeException() throws Exception {
        throw new Exception("homeException 错误");

    }

    @RequestMapping("/homeException415")
    public String homeException415(String name) throws Exception {
        throw new Exception("homeException415 错误");

    }

    @RequestMapping(value = "/homeException400",method = RequestMethod.POST)
    public String homeException400(@RequestParam("name") String name) throws Exception {
        throw new Exception("homeException400 错误");
    }

}
